<?php


use yii\helpers\Url;

?>


<?php echo $this->render("/layouts/top")?>
<script type="text/javascript" charset="utf-8" src="/js/Ajax141212.js"></script>

<div style="margin:0px auto; width:1000px;">
<input id="id1" type="text"/> <===> <input id="id2" type="text"/> <input id="exchangeButton" type="button" value="交换"/>
</div>
<br>

<script language="javascript">

document.getElementById("exchangeButton").onclick = function(){
	
	var id1 = document.getElementById("id1").value;
	var id2 = document.getElementById("id2").value;

	new Ajax().get({
		url : '<?php echo Url::to(['/recite/async-exchange'])?>?id1='+id1+'&id2='+id2,
		resultType : 'json',
		onLoaded : function(result){
			if(result.code == 1){
				alert("交换成功");	
			}else{
				alert(result.info);	
			}
		}
	});	
}
	
</script>
<?php echo $this->render("/layouts/footer")?>